<?php

/**
 * MenuDetalle form.
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class MenuDetalleForm extends BaseMenuDetalleForm
{
  public function configure()
  {
      //Eliminar los campos del formularios  created_at y updated_at
      unset (
        $this['created_at'],
        $this['updated_at'],
        $this['orden'],
        $this['nombre']

      );
      
      $this->widgetSchema['empresa_id'] = new sfWidgetFormInputHidden(array(),array('value'=> sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')));
      //Cambiar a lista y su validador de los status Activo e Inativo 0/1
      $this->widgetSchema['status'] = new sfWidgetFormChoice(array(
         'choices' => MenuDetalle::$status,
         'expanded' => false,
         'multiple' => false,

      ));

      $this->validatorSchema['status'] = new sfValidatorChoice(array(
          'choices' => array_keys(MenuDetalle::$status),

      ));


       //Cambiar a lista de padres
      $this->widgetSchema['padre'] = new sfWidgetFormChoice(array(
         'choices' => MenuDetalle::getMenuDArray2(),
         'expanded' => false,
         'multiple' => false,
      ));
      
       $this->validatorSchema['padre'] = new sfValidatorChoice(array(
          'choices' => array_keys(MenuDetalle::getMenuDArray2()),

      ));
  }
}
